# 要求解析JSON数据，并打印输出未来5天的各项天气情况
# 解析JSON数据
import json
fr = open("天气预报.json", "r", encoding='utf-8')
ls = json.load(fr)
data = [list(ls[0].keys())]
for item in ls:
    data.append(list(item.values()))
fr.close()
fw = open("天气预报json_from_json.csv", "w")
for item in data:
    fw.write(",".join(item) + "\n")
fw.close()